#!/bin/sh

mkdir -p ${DESTDIR}/${PREFIX}/{bin,share/{snapfly,locale/ru/LC_MESSAGES}}

find . -name ".svn" -type d -exec rm -rf {} \;

cp -a src/images ${DESTDIR}/${PREFIX}/share/snapfly
cp src/images/snapfly.png ${DESTDIR}/${PREFIX}/share/icons/hicolor/snapfly.png
cp -a src/snapfly_core ${DESTDIR}/${PREFIX}/share/snapfly
cat src/snapfly > ${DESTDIR}/${PREFIX}/share/snapfly/snapfly
cat src/snapfly-show > ${DESTDIR}/${PREFIX}/share/snapfly/snapfly-show
 
cd lang
msgfmt ru_RU.po
 
cd ..
mv lang/messages.mo ${DESTDIR}/${PREFIX}/share/locale/ru/LC_MESSAGES/snapfly.mo
 
chmod 755 ${DESTDIR}/${PREFIX}/share/snapfly/snapfly
chmod 755 ${DESTDIR}/${PREFIX}/share/snapfly/snapfly-show
 
ln -s ${PREFIX}/share/snapfly/snapfly ${DESTDIR}/${PREFIX}/bin/
ln -s ${PREFIX}/share/snapfly/snapfly-show ${DESTDIR}/${PREFIX}/bin/

